From b4a7fc7d75394822dc389f05c4f6783f1f3183cc Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 15 Oct 2016 05:02:20 +0200 Subject: [PATCH] tests: Remove code from testinput that does nothing --- tests/testinput.c | 64 ----------------------------------------------- 1 file changed, 64 deletions(-) diff --git a/tests/testinput.c b/tests/testinput.c index 15789c8815..b22fa3ad0b 100644 --- a/tests/testinput.c +++ b/tests/testinput.c @@ -31,56 +31,6 @@ static cairo_surface_t *surface = NULL; -/* Information about cursor */ - -static gint cursor_proximity = TRUE; -static gdouble cursor_x; -static gdouble cursor_y; - -/* Unique ID of current device */ -static GdkDevice *current_device; - -/* Erase the old cursor, and/or draw a new one, if necessary */ -static void -update_cursor (GtkWidget *widget, gdouble x, gdouble y) -{ - static gint cursor_present = 0; - gint state = !gdk_device_get_has_cursor (current_device) && cursor_proximity; - - x = floor (x); - y = floor (y); - - if (surface != NULL) - { -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget)); -G_GNUC_END_IGNORE_DEPRECATIONS - - if (cursor_present && (cursor_present != state || - x != cursor_x || y != cursor_y)) - { - cairo_set_source_surface (cr, surface, 0, 0); - cairo_rectangle (cr, cursor_x - 5, cursor_y - 5, 10, 10); - cairo_fill (cr); - } - - cursor_present = state; - cursor_x = x; - cursor_y = y; - - if (cursor_present) - { - cairo_set_source_rgb (cr, 0, 0, 0); - cairo_rectangle (cr, - cursor_x - 5, cursor_y -5, - 10, 10); - cairo_fill (cr); - } - - cairo_destroy (cr); - } -} - /* Create a new backing surface of the appropriate size */ static gint configure_event (GtkWidget *widget, GdkEventConfigure *event) @@ -184,9 +134,6 @@ print_axes (GdkDevice *device, gdouble *axes) static gint button_press_event (GtkWidget *widget, GdkEventButton *event) { - current_device = event->device; - cursor_proximity = TRUE; - if (event->button == GDK_BUTTON_PRIMARY && surface != NULL) { @@ -200,8 +147,6 @@ button_press_event (GtkWidget *widget, GdkEventButton *event) motion_time = event->time; } - update_cursor (widget, event->x, event->y); - return TRUE; } @@ -223,9 +168,6 @@ motion_notify_event (GtkWidget *widget, GdkEventMotion *event) gint n_events; int i; - current_device = event->device; - cursor_proximity = TRUE; - if (event->state & GDK_BUTTON1_MASK && surface != NULL) { if (gdk_device_get_history (event->device, event->window, @@ -260,7 +202,6 @@ motion_notify_event (GtkWidget *widget, GdkEventMotion *event) print_axes (event->device, event->axes); - update_cursor (widget, event->x, event->y); return TRUE; } @@ -271,16 +212,12 @@ motion_notify_event (GtkWidget *widget, GdkEventMotion *event) static gint proximity_out_event (GtkWidget *widget, GdkEventProximity *event) { - cursor_proximity = FALSE; - update_cursor (widget, cursor_x, cursor_y); return TRUE; } static gint leave_notify_event (GtkWidget *widget, GdkEventCrossing *event) { - cursor_proximity = FALSE; - update_cursor (widget, cursor_x, cursor_y); return TRUE; } @@ -305,7 +242,6 @@ main (int argc, char *argv[]) gtk_init (&argc, &argv); seat = gdk_display_get_default_seat (gdk_display_get_default ()); - current_device = gdk_seat_get_pointer (seat); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_name (window, "Test Input"); -- 2.30.2